package com.example.demo3.controller;

import com.example.demo3.bean.ClassInfo;
import com.example.demo3.bean.Person;
import com.example.demo3.bean.Persons;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class HelloController {

    @Autowired
    Person person;

    @Autowired
    ClassInfo classinfo;

    @Autowired
    Persons persons;

    @ResponseBody
    @RequestMapping("/")
    public String index() {
        return "weclome!";
    }



    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        return "Hello World!";
    }

    @ResponseBody
    @RequestMapping("/person")
    public Object  person(){
        return person;
    }

    @ResponseBody
    @RequestMapping("/classinfo")
    public Object  classinfo(){
        return classinfo;
    }

    @ResponseBody
    @RequestMapping("/persons")
    public Object persons(){
        return  persons;
    }


}